package com.boot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.boot.ao.login.AddLoginAO;
import com.boot.entity.Info;
import com.boot.mapper.InfoMapper;
import com.boot.service.InfoService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class InfoServiceImpl extends ServiceImpl<InfoMapper, Info> implements InfoService {
    @Resource
    private InfoMapper loginMapper;

    public List<Info> getList() {
        return loginMapper.getList();
    }

    @Override
    public void addLogin(AddLoginAO addLoginAO) {
        Info login=new Info();
        BeanUtils.copyProperties(addLoginAO,login);
        loginMapper.insert(login);
    }

    @Override
    public void delLogin(Long id) {
        loginMapper.deleteById(id);
    }

}
